package chitiet;

import java.awt.Button;
import java.awt.FlowLayout;
import java.awt.Frame;
import java.awt.GridLayout;
import java.awt.Label;
import java.awt.Panel;
import java.awt.TextField;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class chitiet extends Frame implements ActionListener{
	Button btxem, btexit;
	TextField txtmay, txttien,txtphatsinh,txttgian,txtbatdau;
	Label lb1,lbmay,lbtien,lbtgian,lbphatsinh,lbbatdau;
	Panel pn1,pn2,pn,pn3;
	
	public void GUI(){
		lb1=new Label("CHI TIẾT");
		lbmay=new Label("SỐ MÁY");
		lbtien=new Label("TIỀN THANH TOÁN");
		lbphatsinh=new Label("TIỀN PHÁT SINH");
		lbtgian=new Label("THỜI GIAN CHƠI");
		lbbatdau=new Label("GIỜ BẮT ĐẦU");
		txtmay=new TextField("");
		txttien=new TextField("");
		txtphatsinh=new TextField("");
		txttgian=new TextField("");
		txtbatdau=new TextField("");
		btxem=new Button("XEM");
		btexit=new Button("THOÁT");
		btxem.addActionListener(this);
		btexit.addActionListener(this);
		pn=new Panel(new GridLayout(3, 1));
		pn1=new Panel(new FlowLayout());
		pn2=new Panel(new GridLayout(5, 2));
		pn3=new Panel(new FlowLayout());
		pn1.add(lb1);
		pn2.add(lbmay); pn2.add(txtmay);
		pn2.add(lbbatdau); pn2.add(txtbatdau);
		pn2.add(lbphatsinh); pn2.add(txtphatsinh);
		pn2.add(lbtgian); pn2.add(txttgian);
		pn2.add(lbtien); pn2.add(txttien);
		pn3.add(btxem); pn3.add(btexit); 
		pn.add(pn1); pn.add(pn2); pn.add(pn3);
		add(pn);
		setSize(400	, 300);
		show();
	}
	@Override
	public void actionPerformed(ActionEvent e) {
		// TODO Auto-generated method stub
		if(e.getSource()==btexit)
			System.exit(0);
	}
	public chitiet(String st){
		super(st);
		GUI();
	}
	public static void main(String[] avg){
		new chitiet(" CHI TIẾT");
	}
}
